﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using WpfElevator.ControlPart;
using AbstractFramework.Constant;
using AbstractFramework.LogicControl;

namespace WpfElevator.RequisitionPart
{
    class Event : IEvent
    {
        private EventType m_eventType;//事件类型
        private int m_requisitionFloor;//目的楼层
        private int m_ID;//电梯编号
        private int m_updown;//外部按钮请求向上还是向下
        private int m_Floor;//外部按钮所在的楼层
        public EventType eventType
        {
            get
            {
                return m_eventType;
            }
            set
            {
                m_eventType = value;
            }
        }
        public int requisitionFloor
        {
            get
            {
                return m_requisitionFloor;
            }
            set
            {
                m_requisitionFloor = value;
            }
        }
        public int updown
        {
            get
            {
                return m_updown;
            }
            set
            {
                m_updown = value;
            }
        }
        public int floor
        {
            get
            {
                return m_Floor;
            }
            set
            {
                m_Floor = value;
            }
        }
        public int ID
        {
            get
            {
                return m_ID;
            }
            set
            {
                m_ID = value;
            }
        }

        public Event()
        {
        }
        public Event(EventType reqType, int floor, int id)
        {
            if (reqType == EventType.insideEvent)//内部按钮产生事件
            {
                eventType = reqType;
                requisitionFloor = floor;
                ID = id;
            }
            else if (reqType == EventType.outsideEvent)//外部按钮产生事件，参数包括请求楼层和上下行标识
            {
                eventType = reqType;
                updown = id;//0表示向下，1表示向上
                this.floor = floor;
            }
            else
            {
                Console.WriteLine("错误");
            }

        }
        public Event(EventType reqType)
        {
            eventType = reqType;
        }
        //public void createNewEvent(Event eve)
        //{
        //    SystemConstant.controller.addEvent(eve);

        //}
    }
}
